#!/usr/bin/env bash

ip=`ifconfig eth0|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"`
hn=`cat /etc/hostname`
echo $ip
echo $hn

docker ps -a|grep Exited |awk '{print $1}'|xargs docker rm >/dev/null 2>&1
docker ps -a|grep php56 |awk '{print $1}'|xargs docker stop >/dev/null 2>&1
docker ps -a|grep php56 |awk '{print $1}'|xargs docker rm >/dev/null 2>&1
docker ps -a|grep nginx80 |awk '{print $1}'|xargs docker stop >/dev/null 2>&1
docker ps -a|grep nginx80 |awk '{print $1}'|xargs docker rm >/dev/null 2>&1

service httpd start